var common = require("common");
cc.Class({
    extends: cc.Component,

    properties: {
        guanbiBtn:cc.Button,
        baocuoBtn:cc.Button,
        shengciBtn:cc.Button,
        fenxiangBtn:cc.Button,
        chengyu:cc.Label,
        pinyin:cc.Label,
        shiyi:cc.Label,
        chuchu:cc.Label,
    },
    onLoad () 
    {
        this.guanbiBtn.node.on("click",this.OnGuanBiBtn,this);
        this.baocuoBtn.node.on("click",this.OnBaoCuoBtn,this);
        this.shengciBtn.node.on("click",this.OnShengCiBtn,this);
        this.fenxiangBtn.node.on("click",this.OnFenXiangBtn,this);

        console.log(common.CurIdiom);
        // for (let i = 0; i < common.AllIdiom.length; i++) {
        //     let str = common.AllIdiom[i].split("	");
        //     if (common.CurIdiom == str[1]) {
        //         this.chengyu.string = str[1];
        //         this.pinyin.string = str[2];
        //         this.shiyi.string = str[3];
        //         this.chuchu.string = str[4];
        //     }
        // }
    },
    OnGuanBiBtn:function(event)
    {
        this.chengyu.string = "";
        this.pinyin.string = "";
        this.shiyi.string = "";
        this.chuchu.string = "";
        this.node.active = false;
    },
    OnBaoCuoBtn:function(event)
    {
        
    },
    OnShengCiBtn:function(event)
    {
        //添加到生词本
    },
    OnFenXiangBtn:function(event)
    {
        
    },
    start () {
        
    },
    // update (dt) {},
});
